/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ncrnadb.ncinetview.internal.ui;


import java.awt.Color;
import javax.swing.BoxLayout;
import javax.swing.border.EmptyBorder;

import ncrnadb.ncinetview.internal.request.ListRequestResult;

import org.fusesource.jansi.Ansi;

/**
 *
 * @author vbonnici
 */
public class ListResultPanel extends javax.swing.JPanel {

    private Color bColor = Color.WHITE;
    private ListRequestResult lrr = null;
    
    /**
     * Creates new form ListResultPanel
     */
    public ListResultPanel(Color c, ListRequestResult r) {
        this.bColor = c;
        this.setBackground(bColor);
        lrr = r;
        initComponents();
        
        this.jPanel1.setBackground(bColor);
        this.jPanel2.setBackground(bColor);
        
        
        //TODO
        String cont = "";
        for(String s : r.inputAliases)
            cont+= "\t"+s+"\n";
        this.iaLabel.setText("Input Aliases: \n" + cont);
        
        cont = "";
        for(String s : r.allAliases)
            cont+= "\t"+s+"\n";
        
        this.laLabel.setText("All found Aliases: \n" + cont);
        
        cont = "";
        for(String s : r.entitiesRIDs)
            cont+= "\t"+s+"\n";
        this.edLabel.setText("Found Entity RIDs: " + cont);
        
        r.selected = true;
        
        //this.chartsPanel.setLayout(new BoxLayout(this.chartsPanel, BoxLayout.Y_AXIS));
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        selectedCheckBox = new javax.swing.JCheckBox();
        jPanel2 = new javax.swing.JPanel();
        iaLabel = new javax.swing.JLabel();
        laLabel = new javax.swing.JLabel();
        edLabel = new javax.swing.JLabel();

        setBorder(new EmptyBorder(10, 10, 10, 10) );
        setLayout(new java.awt.BorderLayout());

        selectedCheckBox.setSelected(true);
        selectedCheckBox.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                selectedCheckBoxStateChanged(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(selectedCheckBox)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(selectedCheckBox)
                .addContainerGap(25, Short.MAX_VALUE))
        );

        add(jPanel1, java.awt.BorderLayout.LINE_END);

        jPanel2.setLayout(new javax.swing.BoxLayout(jPanel2, javax.swing.BoxLayout.Y_AXIS));

        iaLabel.setText("Input Alias RIDs: ");
        jPanel2.add(iaLabel);

        laLabel.setText("All found Alias RIDs: ");
        jPanel2.add(laLabel);

        edLabel.setText("Found Entity RIDs: ");
        jPanel2.add(edLabel);

        add(jPanel2, java.awt.BorderLayout.CENTER);
    }// </editor-fold>//GEN-END:initComponents

    private void selectedCheckBoxStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_selectedCheckBoxStateChanged
        this.lrr.selected = this.selectedCheckBox.isSelected();
    }//GEN-LAST:event_selectedCheckBoxStateChanged

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel edLabel;
    private javax.swing.JLabel iaLabel;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JLabel laLabel;
    private javax.swing.JCheckBox selectedCheckBox;
    // End of variables declaration//GEN-END:variables
}
